/**
 * 按规则构图
 */
#include <bits/stdc++.h>
using namespace std;

const array<int, 7> L {1, 3, 9, 27, 81, 81 * 3, 81 * 3 * 3};

int N;
vector<string> Board;

void dfs(int n, int r, int c){
    if(0 == n){
        Board[r][c] = '#';
        return;
    }

    if(1 == n){
        Board[r + 1][c + 1] = '.';
        Board[r][c] = Board[r][c + 1] = Board[r][c + 2] = '#';
        Board[r + 1][c] = Board[r + 1][c + 2] = '#';
        Board[r + 2][c] = Board[r + 2][c + 1] = Board[r + 2][c + 2] = '#';
        return;
    }

    int unit = L[n - 1];
    for(int i=r+unit;i<r+unit*2;++i)for(int j=c+unit;j<c+unit*2;++j){
        Board[i][j] = '.';
    }

    dfs(n - 1, r, c);
    dfs(n - 1, r, c + unit);
    dfs(n - 1, r, c + unit * 2);
    dfs(n - 1, r + unit, c);
    dfs(n - 1, r + unit, c + unit * 2);
    dfs(n - 1, r + unit * 2, c);
    dfs(n - 1, r + unit * 2, c + unit);
    dfs(n - 1, r + unit * 2, c + unit * 2);
    return;
}

void work(){
    cin >> N;
    Board.assign(L[N], string(L[N], '.'));
    dfs(N, 0, 0);
    for(const auto & s : Board) cout << s << "\n";
    return;
    return;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase; 
    while(nofkase--) work();
    return 0;
}